package MiddleWareTest;
use strict;
use warnings;

use base qw(Test::Class);
use Test::More;
use Data::Dumper;

use lib '/home/'.$ENV{USER}.'/djpp/core/service';
use lib '/home/'.$ENV{USER}.'/djpp/core/model';
use lib '/home/'.$ENV{USER}.'/djpp/core/t';
use MiddleWare;
use Request;
use MockObjects;

sub testSetup : Test(setup)
{
	my $self = shift;
	
	$self->{middle} = new MiddleWare( MockObjects::getSettingsMock->middle_ware );
}

sub testCheckThatReturnRequest : Test
{
	my $self = shift;
	
	my $request = new Request( realrequest =>  MockObjects::getApacheMock );
	my $expected_request = $self->{middle}->handle( $request );
	
	ok ( ref $expected_request eq ref $request, "The Request not changed" );
}
1;